package com.zhangkeyou.map.mapweb.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhangkeyou.map.mapweb.domain.entity.MapData;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface MapDataMapper extends BaseMapper<MapData> {
    @Select("select * from map where userinfo_id = #{userinfoId}")
    List<MapData> selectByUserId(String userinfoId);

    @Delete("delete from map where id=#{id} and userinfo_id = #{userinfoId}")
    long deleteByIdAndUserId(MapData mapData);

    @Select("select * from map where id = #{id}")
    MapData selectMapDataById(String id);

    @Update("update map set data = #{data} where id =#{id}")
    int updateMapdataData(@Param("id") String id,@Param("data") String dataInDatabaseJSONObject);

}
